package com.nightsoul.groovy

import java.lang.NumberFormatExceptionpublic class UseCategory{

	public static void main(String[] args) {
		def self = "skldjf";
		def other = "ksdjf";
		println self <<= other;
		println self;
		
		use(StringCalculationCategory) {
			def str = "5";
			println str.plus('6');
			println str + "7";
			println str + "7x";
		}
	}
	
}

class StringCalculationCategory {
	static def plus(String self, String other) {
		try {
			return self.toInteger() + other.toInteger();
		} catch(NumberFormatException ex) {
			return self << other;
		}
	}
}